package com.issac.entity;


import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class Student {
    @NotNull(message = "id不能为空")
    private Long id;
    @NotEmpty(message = "名字不能为空")
    @Length(min = 2,max = 4,message = "名字不能少于2位，不能长于4位")
    private String name;
    @Min(value = 18,message = "用户年龄必须大于18岁")
    private int age;
    private String address;
}
